// mine/pages/personal.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    show: false,
    actions: [
      { name: '着色选项', color: '#ee0a24' },
      { loading: true },
      { name: '禁用选项', disabled: true },
    ],
    menuList:[
      {
        id:1,
        menuName:'性别',
        ShowRed:false,
        chose:'男',
        show:false,
      },
      {
        id:2,
        menuName:'高考年份',
        ShowRed:true,
        chose:'请选择',
        show:false,
      },
      {
        id:3,
        menuName:'民族',
        ShowRed:false,
        chose:'请选择',
        show:false,
      },
      {
        id:4,
        menuName:'高考省份',
        ShowRed:true,
        chose:'请选择',
        show:false,
      },
      {
        id:5,
        menuName:'所在城市',
        ShowRed:true,
        chose:'请选择',
        show:false,
      },
      {
        id:6,
        menuName:'所在县区',
        ShowRed:true,
        chose:'请选择',
        show:false,
      },
      {
        id:7,
        menuName:'所在高中',
        ShowRed:true,
        chose:'请选择',
        show:false,
      },
      {
        id:8,
        menuName:'所在校区',
        ShowRed:true,
        chose:'请选择',
        show:false,
      },
      {
        id:9,
        menuName:'文理',
        ShowRed:false,
        chose:'请选择',
        show:false,
      },
    ],
    actionList:[
      {
        id:1,
        menuList:[
          {
            name:"男",
            id:1,
          },
          {
            name:"女",
            id:2,
          },
        ]
      },{
        id:2,
        menuList:[
          {
            name:"2023",
            id:1,
          },
          {
            name:"2024",
            id:2,
          },
          {
            name:"2025",
            id:2,
          },
          {
            name:"2026",
            id:2,
          },
        ]
      }
    ],
    columns: ['杭州', '宁波', '温州', '嘉兴', '湖州'],
    index:0,
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onClose() {
    this.setData({ show: false });
  },
  // 取消选择
  // onCancel() {
  // },
  onLoad(options) {
    // debugger;
    // console.log(options)

  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady() {

  },
  showPopup(e){
    let _self =this;
    console.log(e)
    console.log("我被点了")
    let index = e.currentTarget.dataset.index;
    console.log(index)
    this.data.index=index
    // console.log(typeof(index))
    switch(index){
      case 0:
         let list =["男",'女']
         this.data.columns=list
         break;
         case 1:
          let yearList =["2023",'2024',"2025","2026"]
          this.data.columns=yearList
          break;
         case 2:
          let nationList =["汉族",'民族',"蒙古族","维吾尔族"]
          this.data.columns=nationList
          break;
         case 3:
          let cityList =["扬州",'广西',"安徽","重庆","西安"]
          this.data.columns=cityList
          break;
         case 4:
          let countyList =["汉族",'民族',"蒙古族","维吾尔族"]
          this.data.columns=countyList
          break;
         case 5:
          let levelList =["A全区",'B全区',"c全区"]
          this.data.columns=levelList
          break;
         case 6:
          let seniorList =["A学校",'B学校',"c学校","d学校"]
          this.data.columns=seniorList
          break;
         case 7:
          let schoolList =["蜻蜓志愿总部","商务运营总部"]
          this.data.columns=schoolList
          break;
         case 8:
          let unityList =["文科",'理科',"未分科"]
          this.data.columns=unityList
          break;
          default:
            break;
        //  case 6:
        //   let countyList =["汉族",'民族',"蒙古族","维吾尔族"]
        //   this.data.columns=countyList
        //   break;

    }
    this.setData({
      show:true,
      index:index,
      columns:this.data.columns
    })

  },
  // 确定选择
  onConfirm(event) {
    // const { picker, value, index } = event.detail;
    // Toast(`当前值：${value}, 当前索引：${index}`);
    this.setData({ show: false });
  },
  // 取消选择
  onCancel() {
    // Toast('取消');
    this.setData({ show: false });

  },


  /**
   * 生命周期函数--监听页面显示
   */
  onShow() {

  },
  // showPopup() {
  //   this.show = true;
  // },


  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide() {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload() {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh() {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom() {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage() {

  }
})